 <route lang="json5"  >
 {
   layout: 'default',
   style: { 
     navigationBarTitleText: '论文详情',
   },
 }
 </route> 
   
<template>
	<view class="u-page"  style="padding-top:0;height: 250px;background-image: linear-gradient(#1b90ff, #ffffff);">
		 
		<swiper class="swiper" :indicator-dots="true" :circular="true" :autoplay="true" :interval="5000" :duration="500">
		  <swiper-item v-for="(item, index) in house.img" :key="index" @click="toViewPic(index)" >
		    <image :src="item" mode="aspectFit"  ></image>
		  </swiper-item>
		 </swiper>  
		<view style="background-color: #f7f7f7;padding:30upx;font-size:16px;"> 
			  <view class="inline-container">
				 <view class="inline-item">论文标题:</view> <view class="inline-item">{{house.paperTitle}} </view>
			  </view>
			  <view class="inline-container">
			  	 <view class="inline-item">论文作者:</view> <view class="inline-item">{{house.paperAuthor}} </view>
			    </view> 
			  <view class="inline-container"> 
			  	 <view class="inline-item">论文领域:</view> <view class="inline-item">{{house.paperFieldType_dictText}} </view>
			    </view>  
			<view class="inline-container"> 
				 <view class="inline-item">发表时间:</view> <view class="inline-item">{{house.publicationTime}} </view>
			  </view>   
			<view class="inline-container">
				 <view class="inline-item">论文摘要:</view> <view class="inline-item">{{house.paperAbstract}} </view>
			  </view>  
		<!-- <view class="inline-container">
			 <view class="inline-item">专利简介:</view> <view class="inline-item">{{house.patentAbstract}} </view>
		  </view> -->
		 
			<view style="margin-bottom:50upx;">
				 <view class="inline-item">论文简介:</view>
				  <view  > 
					  <rich-text  :nodes="house.paperIntroduction" />
				  </view>
			  </view> 
		</view>
		 
	</view>
</template>

<script>
	import {http} from '@/utils/http' 
	export default {
		data() {
			const d = new Date()
			const year = d.getFullYear() 
			const date = d.getDate()
			return {
				minTime: d.getMilliseconds(),
				showTime:false,
				model1:{}, 
				show: false, 
				title: '居中弹出',
				iconUrl: 'https://cdn.uviewui.com/uview/demo/popup/modeCenter.png',
				current: 0, 
				id:'',
				house:{}
			}
		},
		onLoad(options){
			this.id=options.id;
			console.log(this.id)
			uni.showLoading({
				title:'正在加载...'
			})
			http.get("/api/papers/queryById",{id:this.id}).then(res=>{
				uni.hideLoading()
				console.log(res)
				if(res.result.imageurl){
				  var imgsArr=res.result.imageurl.split(",")
				  for(var i=0;i<imgsArr.length;i++){
					imgsArr[i]=getApp().globalData.imgUrl+ imgsArr[i];
				  }
				  res.result.img=imgsArr;
				  
				}else{
				  res.result.img=["/static/images/nopic.png"];
				}
				 if(res.result.paperIntroduction){
					 res.result.paperIntroduction=res.result.paperIntroduction.replace(/&mdash;/g, '\u2014') // 替换为 em dash
            .replace(/&amp;/g, '&')
            .replace(/&lt;/g, '<')
            .replace(/&gt;/g, '>');
				 }
				this.house=res.result;
			})
		},
		mounted(){
			//this.toGetInfo()
			 
		},
		methods: {
			hitTime(){
				console.log(this.minTime);this.showTime = true; this.hideKeyboard()
			},
			 toViewPic(index){
				 uni.previewImage({
				 	urls:this.house.img,
					current: index
				 })
			 },
			 toMapIt(){
				 // uni.openLocation({
				 	
				 // })
				 uni.openLocation({
				 	latitude:this.house.yPos,
					longitude:this.house.xPos,
					name:this.house.houseTitle ,
					address: this.house.address
				 })
			 },
			 toJjr(){
				 uni.navigateTo({
				 	url:'/pages/main/jjritem?id='+this.house.userId
				 })
			 },
			 
			 
			 hideKeyboard() {
			 	uni.hideKeyboard()
			 },
			 changeTime(e) {
			 	// console.log('change', e)
			 },
			 toShare(){
				 uni.share({ 
				                    provider: "weixin",
				                    scene: "WXSceneSession",
				                    type: 0,
				                    href: "http:*******************",//这地址太长了，就省略了
				                    title: this.house.houseTitle,
				                    summary: "",                         
				                    imageUrl: this.house.img[0],
				                    success: function(res) {
				                        console.log("success:" + JSON.stringify(res));
				                    },
				                    fail: function(err) {
				                        console.log("fail:" + JSON.stringify(err));
				                    }
				                });
			 
			 },
			 toSaveMeet(){
				 this.$refs.form1.validate().then(res => {
					 this.model1.houseId=this.house.id;
					 this.model1.userId=this.house.userId;
				 				addMeet(this.model1).then(res1=>{
									if(res1.code==200){
										uni.showToast({
											title:"预约成功",
											icon:'none'
										}) ;
										this.show=false
									}
								})
				 			}).catch(errors => {
				 				uni.$u.toast('校验失败')
				 			})
			 }
		}
	}
</script>

<style  lang="scss" scoped>
	@import '@/common/uni-ui.scss';
	
	.swiper {
	  height: 375upx;
	  flex: none;
	  image,
	  video {
	    width: 100%;
	    display: block;
	    height: 100%;
	    margin: 0;
	  }
	  :deep(.uni-swiper-dot) {
	    transition: all 400ms ease;
	    background-color: rgba(255, 255, 255, 0.4);
	    width: 5px;
	    height: 5px;
	    border-radius: 50%;
	    margin: 0 4px;
	  }
	  :deep(.uni-swiper-dot-active) {
	    background-color: rgba(255, 255, 255, 1);
	    width: 16px;
	    border-radius: 2px;
	  }
	}
   .wrap {
        padding: 12px;
    }

    .demo-layout {
        height: 70rpx;
        border-radius: 4px;
    }

    .bg-purple {
        background: #CED7E1;
    }

    .bg-purple-light {
        background: #e5e9f2;padding:10rpx;font-size:0.9em;
    }

    .bg-purple-dark {
        background: #99a9bf;
    }
	
	::v-deep img{
			 width: 100%!important;
	}
	 
	 
	.inline-container {
	    /* 消除inline-block间隙 */
		display: inline-block;
		width:100%;
	}
	
	.inline-item {
	  display: inline-block;
	  font-weight: bold; 
	  vertical-align: middle;  /* 垂直对齐 */ 
	  margin-right: 20upx;
	}
	
	.inline-item:last-child {
		font-weight: normal; 
	  margin-right: 0;
	}
	 
</style>
